home *** CD-ROM | disk | FTP | other *** search
- // This may look like C code, but it is really -*- C++ -*-
- //
- // Copyright (C) 1988 University of Illinois, Urbana, Illinois
- // Copyright (C) 1989 University of Colorado, Boulder, Colorado
- // Copyright (C) 1990 University of Colorado, Boulder, Colorado
- //
- // written by Dirk Grunwald (grunwald@foobar.colorado.edu)
- //
- #include "CpuMuxExceptions.h"
- #include "ReserveByException.h"
- #include "CpuMultiplexor.h"
- #include "SpinBarrier.h"
- #include "stream.h"
- #include "Thread.h"
-
- void
- ExceptionReserve::handleException()
- {
- if ( toReserve -> reserveByException( ThisCpu -> currentThread ) ) {
- ThisCpu -> currentThread = 0;
- }
- }
-
- void
- ExceptionTerminate::handleException()
- {
- ThisCpu -> currentThread = 0; // do before delete so thread frees stack
- delete deadThread;
- }
-
- void
- ExceptionReschedule::handleException()
- {
- //
- // Switch to another thread when we havenot gotten
- // rid of the current one.
- //
- assert(ThisCpu -> currentThread != 0);
- ThisCpu -> add( ThisCpu -> currentThread );
- ThisCpu -> currentThread = 0;
- }
-
- void
- ExceptionIveSuspended::handleException()
- {
- //
- // Switch to another thread when we havenot gotten
- // rid of the current one.
- //
- ThisCpu -> currentThread = 0;
- }
-